package com.mercator.client.graph;
import org.vaadin.gwtgraphics.client.DrawingArea;
import org.vaadin.gwtgraphics.client.shape.Ellipse;

public class GenNode extends GenStringNode<Ellipse> implements Drawable {
	
	public GenNode(DrawingArea canvas, GenType element) {
		super(canvas, element);
		rep.setRadiusX(20);
		rep.setRadiusY(20);
		rep.setStrokeColor("green");
		rep.setFillColor("white");
		text.setFillColor("blue");
		reps.add(text);
		first = false;
	}
	
	public GenNode(Gene element){
		super(element);
	}
	
	public void unselect(){
		super.unselect();
		rep.setStrokeColor("green");
		rep.setFillColor("white");
		text.setFillColor("blue");
	}
	
	

	@Override
	public GenNode getThis() {
		return this;
	}

	@Override
	public boolean equals(Object o) {
		return this.element.equals(((GenNode)o).element);
	}

	@Override
	public int hashcode() {
		return this.element.hashCode();
	}

	@Override
	protected Ellipse getShape() {
		return new Ellipse(0,0,0,0);
	}

	@Override
	protected void setSize(int x, int y) {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected int getCenterX() {
		return rep.getX();
	}

	@Override
	protected int getCenterY() {
		return rep.getY();
	}
	
	@Override
	protected int getTargetCenterX() {
		return tx_pos;
	}

	@Override
	protected int getTargetCenterY() {
		return ty_pos;
	}

}
